/* Kertext UI by kuiwaiwai */
/* kertext-container */
.kertext-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* kertext-heading */
.kertext-heading,
.kertext-heading1,
.kertext-heading2,
.kertext-heading3,
.kertext-heading4,
.kertext-heading5,
.kertext-heading6 {
    font-weight: bold;
    margin-bottom: 10px;
}

.kertext-heading,
.kertext-heading1 {
    font-size: 2.5em;
}

.kertext-heading2 {
    font-size: 2em;
}

.kertext-heading3 {
    font-size: 1.75em;
}

.kertext-heading4 {
    font-size: 1.5em;
}

.kertext-heading5 {
    font-size: 1.25em;
}

.kertext-heading6 {
    font-size: 1em;
}

/* kertext-subheading */
.kertext-subheading {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 10px;
}

/* kertext-paragraph */
.kertext-paragraph {
    font-size: 1.2em;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* kertext-quote */
.kertext-quote {
    font-style: italic;
    border-left: 3px solid #ccc;
    padding-left: 10px;
}

/* kertext-link */
.kertext-link {
    color: #0077cc;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.kertext-link:hover {
    color: #005fa3;
}

/* kertext-hr */
.kertext-hr {
    border: none;
    height: 1px;
    background-color: #ccc;
    margin: 20px 0;
}

.kertext-hr-empty {
    border: none;
    height: 2px;
    background-color: none;
    margin: 20px 0;
}

/* kertext-code */
.kertext-code {
    background-color: #f4f4f4;
    color: #333;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    line-height: 1.5;
    padding: 10px;
    margin-bottom: 20px;
}

/* kertext-code-line */
.kertext-code-line {
    display: block;
}

/* kertext-code-highlight */
.kertext-code-highlight {
    background-color: #fff9b7;
}

/* kertext-button */
.kertext-button,
.kertext-button-primary,
.kertext-button-secondary,
.kertext-button-success,
.kertext-button-danger,
.kertext-button-warning,
.kertext-button-info,
.kertext-button-light,
.kertext-button-dark {
    display: inline-block;
    padding: 10px 20px;
    color: #fff;
    border-radius: 4px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
    user-select: none;
    outline: none;
    border: none;
}

.kertext-button {
    background-color: #fff;
    border: solid #999 1px;
    color: #333;
}

.kertext-button-primary {
    background-color: #0077cc;
}

.kertext-button-secondary {
    background-color: #6c757d;
}

.kertext-button-success {
    background-color: #28a745;
}

.kertext-button-danger {
    background-color: #dc3545;
}

.kertext-button-warning {
    background-color: #ffc107;
}

.kertext-button-info {
    background-color: #17a2b8;
}

.kertext-button-light {
    background-color: #f8f9fa;
    color: #212529;
}

.kertext-button-dark {
    background-color: #343a40;
}

.kertext-button:hover {
    background-color: #999;
}

.kertext-button-primary:hover {
    background-color: #0066b3;
}

.kertext-button-secondary:hover {
    background-color: #5a6167;
}

.kertext-button-success:hover {
    background-color: #1e7e34;
}

.kertext-button-danger:hover {
    background-color: #c82333;
}

.kertext-button-warning:hover {
    background-color: #e0a800;
}

.kertext-button-info:hover {
    background-color: #138496;
}

.kertext-button-light:hover {
    background-color: #dae0e5;
    color: #212529;
}

.kertext-button-dark:hover {
    background-color: #23272b;
}

.kertext-button:focus {
    box-shadow: 0 0 0 2px rgba(175, 175, 175, 0.3);
}

.kertext-button-primary:focus {
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.3);
}

.kertext-button-secondary:focus {
    box-shadow: 0 0 0 2px rgba(108, 117, 125, 0.3);
}

.kertext-button-success:focus {
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.kertext-button-danger:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

.kertext-button-warning:focus {
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

.kertext-button-info:focus {
    box-shadow: 0 0 0 2px rgba(23, 162, 184, 0.3);
}

.kertext-button-light:focus {
    box-shadow: 0 0 0 2px rgba(248, 249, 250, 0.3);
}

.kertext-button-dark:focus {
    box-shadow: 0 0 0 2px rgba(52, 58, 64, 0.3);
}

/* kertext-image */
.kertext-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

/* kertext-list */
.kertext-list {
    margin-bottom: 20px;
}

.kertext-list-item {
    list-style: disc;
    margin-left: 20px;
}

/* kertext-form */
.kertext-form {
    display: flex;
    flex-direction: column;
}

.kertext-form-label {
    margin-bottom: 10px;
    font-weight: bold;
}

.kertext-form-input {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
}

.kertext-form-input:focus {
    border-color: #0077cc;
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.3);
}

.kertext-form-textarea {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    resize: vertical;
    min-height: 100px;
}

.kertext-form-textarea:focus {
    border-color: #0077cc;
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.3);
}

.kertext-form-select {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    appearance: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41,8.59L12,13.17l4.59-4.58L18,9l-6,6l-6-6L7.41,8.59z'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 20px 20px;
}

.kertext-form-select:focus {
    border-color: #0077cc;
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.3);
}

.kertext-form-button {
    padding: 10px 20px;
    background-color: #0077cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
    cursor: pointer;
    user-select: none;
    outline: none;
}

.kertext-form-button:hover {
    background-color: #005fa3;
}

.kertext-form-button:focus {
    box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.3);
}

/* kertext-table */
.kertext-table,
.kertext-table-striped,
.kertext-table-bordered,
.kertext-table-hover {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.kertext-table th,
.kertext-table td,
.kertext-table-striped th,
.kertext-table-striped td,
.kertext-table-bordered th,
.kertext-table-bordered td,
.kertext-table-hover th,
.kertext-table-hover td {
    padding: 10px;
    border: 1px solid #ccc;
}

.kertext-table th,
.kertext-table-striped th,
.kertext-table-bordered th,
.kertext-table-hover th {
    font-weight: bold;
    text-align: left;
}

.kertext-table-striped tr:nth-child(even),
.kertext-table-hover tr:nth-child(even) {
    background-color: #f2f2f2;
}

.kertext-table-hover tr:hover {
    background-color: #e9ecef;
}

/* kertext-card */
.kertext-card {
    background-color: #fff;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.kertext-card-header {
    background-color: #f2f2f2;
    padding: 10px;
    font-weight: bold;
}

.kertext-card-body {
    padding: 20px;
}

/* kertext-alert */
.kertext-alert {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.kertext-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.kertext-alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.kertext-alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* kertext-modal */
.kertext-modal {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    /* 设置层级，确保在其他内容上方 */
}

.kertext-modal-dialog {
    background-color: #fff;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
    max-width: 80%;
    max-height: 80%;
    display: flex;
    flex-direction: column;
    position: relative;
    /* 添加相对定位，为关闭按钮绝对定位做准备 */
}

.kertext-modal-header {
    background-color: #f2f2f2;
    padding: 2px 10px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    /* 让标题和关闭按钮两端对齐 */
    align-items: center;
}

.kertext-modal-body {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
}

.kertext-modal-footer {
    background-color: #f2f2f2;
    padding: 5px 10px;
    display: flex;
    justify-content: flex-end;
}

.kertext-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #999;
    cursor: pointer;
    font-size: 24px;
    /* 调整关闭按钮大小 */
}

.kertext-modal-close:hover {
    color: #333;
}

/* kertext-pagination */
.kertext-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.kertext-pagination-item {
    margin-right: 5px;
    padding: 3px 6px;
    border-radius: 4px;
    background-color: #fff;
    border: 1px solid #ccc;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.kertext-pagination-item.active,
.kertext-pagination-item:hover {
    background-color: #0077cc;
    color: #fff;
    border-color: #0077cc;
}

/* kertext-badge */
.kertext-badge,
.kertext-badge-success,
.kertext-badge-danger,
.kertext-badge-warning,
.kertext-badge-info {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.8em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.kertext-badge {
    background-color: #0077cc;
}

.kertext-badge-success {
    background-color: #28a745;
}

.kertext-badge-danger {
    background-color: #dc3545;
}

.kertext-badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.kertext-badge-info {
    background-color: #17a2b8;
}

/* kertext-responsive */
@media (max-width: 768px) {
    .kertext-container {
        max-width: 100%;
        padding: 0 10px;
    }

    .kertext-heading {
        font-size: 2em;
    }

    .kertext-subheading {
        font-size: 1.5em;
    }

    .kertext-paragraph {
        font-size: 1em;
    }

    .kertext-image {
        margin-bottom: 10px;
    }

    .kertext-form-input {
        padding: 5px;
    }

}

@media (max-width: 576px) {
    .kertext-heading {
        font-size: 1.8em;
    }

    复制.kertext-subheading {
        font-size: 1.3em;
    }

    .kertext-paragraph {
        font-size: 1em;
    }

    .kertext-form-label {
        font-size: 0.9em;
    }

    .kertext-form-input,
    .kertext-form-textarea,
    .kertext-form-select,
    .kertext-table th,
    .kertext-table td {
        padding: 8px;
    }

    .kertext-modal-header {
        padding: 1px 6px;
    }

    .kertext-modal-footer {
        padding: 5px;
    }

    .kertext-modal-body {
        padding: 10px;
    }

    .kertext-pagination-item {
        padding: 3px 6px;
    }

    .kertext-modal-close {
        top: 5px;
        /* 调整关闭按钮位置 */
        right: 5px;
    }

}

/* Dark theme */
[data-theme="dark"] {
    background-color: #333;
    color: #fff;
}

[data-theme="dark"] .kertext-quote {
    border-left: 3px solid #999;
}

[data-theme="dark"] .kertext-button {
    background-color: #333;
    color: #fff;
    border: solid #999 1px;
}
[data-theme="dark"] .kertext-button:hover {
    background-color: #999;
}
[data-theme="dark"] .kertext-button:focus {
    box-shadow: 0 0 0 2px rgba(162, 162, 162, 0.3);
}

[data-theme="dark"] .kertext-link {
    color: #80c1ff;
}

[data-theme="dark"] .kertext-link:hover {
    color: #4a9eff;
}

[data-theme="dark"] .kertext-table th,
[data-theme="dark"] .kertext-table td {
    border: 1px solid #999;
}

[data-theme="dark"] .kertext-form-input {
    background-color: #333;
    color: #fff;
}

[data-theme="dark"] .kertext-form-textarea {
    background-color: #333;
    color: #fff;
}

[data-theme="dark"] .kertext-form-select {
    background-color: #333;
    color: #fff;
}

[data-theme="dark"] .kertext-table tr:nth-child(even) {
    background-color: #444;
}

[data-theme="dark"] .kertext-card {
    background-color: #444;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .kertext-card-header {
    background-color: #555;
}

[data-theme="dark"] .kertext-alert-success {
    background-color: #2c5f2c;
    color: #d4edda;
    border: 1px solid #3d7a3d;
}

[data-theme="dark"] .kertext-alert-warning {
    background-color: #5f5b2c;
    color: #fff3cd;
    border: 1px solid #7a7a3d;
}

[data-theme="dark"] .kertext-alert-danger {
    background-color: #5f2c2c;
    color: #f8d7da;
    border: 1px solid #7a3d3d;
}

[data-theme="dark"] .kertext-modal-dialog {
    background-color: #444;
}

[data-theme="dark"] .kertext-modal-header {
    background-color: #555;
}

[data-theme="dark"] .kertext-modal-footer {
    background-color: #555;
}

[data-theme="dark"] .kertext-pagination-item {
    background-color: #444;
    border: 1px solid #999;
}

[data-theme="dark"] .kertext-pagination-item.active,
[data-theme="dark"] .kertext-pagination-item:hover {
    background-color: #80c1ff;
    color: #333;
    border-color: #4a9eff;
}

/* Kertext UI by kuiwaiwai */
/* End */